Repository navigation
Conversation
- Define POOL_CHLORINE_SETPOINT bounds (0-8) and validation logic in setpoints.py - Add set_pool_chlorine_setpoint helper on HaloWebSocketClient to pack all 5 setpoint fields into cmd 0x0066 while preserving existing values - Register pool_chlorine_setpoint_control number entity in number.py with capability bounds support - Add unit tests for setpoints validation, WebSocket command construction, and the number platform
Share controller-aware bounds between the number entity and client, reject fractional/non-finite input before conversion, and validate explicit chlorine changes without restricting unchanged controller snapshots in pH/ORP writes. Fix the test exception stub and import path, cover failure paths, and run the 54 isolated unit tests in CI. Document the new control and test limitations.
|
Verification (from Claude) Hardware validation on a Halo Chlor 45 (fw 2.5, cloud-connected via Entity
Writes (all via
The cell current step (roughly +44 % for a 4→6 change) and the controller's own level readback both confirm the write reached the unit and changed the manual output level, not just the HA-side state. The intermediate Preserved fields: this unit has no acid doser and no pH/ORP probes, so I cannot confirm those fields survived beyond "no error and the setpoint readback matched". Vendor-app readback not checked (the app and HA kick each other off the single cloud session). Unit tests: 32 passed locally; the two remaining modules only failed to import because my sandbox Python lacked the |
|
Reviewed the code manually - ready for maintainer review. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Home Assistant currently exposes the pool chlorine setpoint as a sensor, but does not provide a number entity to adjust it. This adds
pool_chlorine_setpoint_controlalongside the existing pH and ORP controls.The control uses whole steps and controller-reported manual chlorine bounds, falling back to 0–8 when the bounds are unavailable or unusable. It writes through
set_pool_chlorine_setpoint()and the existing0x0066setpoint command, preserving pH, ORP, acid and spa chlorine values from the live snapshot. Missing preserved values prevent the command from being sent. The existing read-only sensor remains available.Review fixes included in this branch:
selectmodule, and run the unit suite in CI.Validation:
python -m unittest discover -s tests -t . -v.git diff --checkpass locally.Kept as a draft for hardware validation. The tests stub Home Assistant and mock network sends; they do not establish full HA setup compatibility or controller acceptance/readback. Before marking ready, confirm the control appears with the expected bounds on a live device, a write changes the intended setting while preserving the other four fields, and the vendor app/controller reports the updated value. The 0–8 fallback is retained from the proposed implementation and still needs confirmation for devices without capability data. This represents the manual controller level, not a measured chlorine concentration.